package com.group9.service.impl;

import com.group9.mapper.CustomerInfoMapper;
import com.group9.mapper.FruitInfoMapper;
import com.group9.pojo.CustomerInfo;
import com.group9.pojo.FruitInfo;
import com.group9.service.ExtraInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

/**
 * Created by Lcouncillor on 2020/6/6.
 */
@Service
public class ExtraInfoServiceImpl implements ExtraInfoService {

    @Autowired
    CustomerInfoMapper customerInfoMapper;

    @Autowired
    FruitInfoMapper fruitInfoMapper;

    @Override
    @Transactional
    public CustomerInfo showCustomerInfoByUserId(String userId) {
        return customerInfoMapper.selectByPrimaryKey(Integer.parseInt(userId));
    }

    @Override
    public FruitInfo showFruitInfoByFruitId(String fruitId) {
        return fruitInfoMapper.selectByPrimaryKey(Integer.parseInt(fruitId));
    }
}
